<?php

namespace app\goods\controller;

use think\Controller;
use think\Request;

class Order extends GoodsController
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index($day = false)
    {
//        dump($day);
//        dump($day);
//        dump($day);
        if($day){
            $day = abs($day);
            $data = db('order')
                ->order('id','desc')
                ->where('selltime','between',[strtotime('today-'.$day.'day'),time()])
                ->paginate(10);
        }else{
            $data = db('order')
                ->order('id','desc')
                ->paginate(10);
//                ->select();
        }
//        dump($data);
        return view('index',['data'=>$data]);
    }


}
